package com.chinacoal.hr;

import com.primeton.eos.dap.sdk.api.bizflow.EnableSDKBizflows;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@EnableFeignClients(basePackages = {"com.chinacoal.hr.levelapi"})
@EnableDiscoveryClient
@SpringBootApplication
@EnableCircuitBreaker
@EnableSDKBizflows
@EnableTransactionManagement
@EnableScheduling
@MapperScan("com.chinacoal.hr.levelimpl.mapper")
public class LevelBootApplication {
//    private CorsConfiguration buildConfig() {
//        CorsConfiguration corsConfiguration = new CorsConfiguration();
//        corsConfiguration.addAllowedOrigin("*");
//        corsConfiguration.addAllowedHeader("*");
//        corsConfiguration.addAllowedMethod("*");
//        corsConfiguration.setAllowCredentials(true);//这两句不加不能跨域上传文件，
//        corsConfiguration.setMaxAge(3600l);//加上去就可以了
//        return corsConfiguration;
//    }
//
//    /**
//     * 跨域过滤器
//     * @return
//     */
//    @Bean
//    public CorsFilter corsFilter() {
//        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
//        source.registerCorsConfiguration("/**", buildConfig()); // 4
//        return new CorsFilter(source);
//    }

    public static void main(String[] args) {

        SpringApplication.run(LevelBootApplication.class, args);
    }

}

